# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This class is auto generated by the swagger code generator program.
# https://github.com/swagger-api/swagger-codegen.git
# Do not edit the class manually.

defmodule GoogleApi.Partners.V2.Model.Location do
  @moduledoc """
  A location with address and geographic coordinates. May optionally contain a detailed (multi-field) version of the address.

  ## Attributes

  - address (String.t): The single string version of the address. Defaults to: `null`.
  - addressLine ([String.t]): The following address lines represent the most specific part of any address. Defaults to: `null`.
  - administrativeArea (String.t): Top-level administrative subdivision of this country. Defaults to: `null`.
  - dependentLocality (String.t): Dependent locality or sublocality. Used for UK dependent localities, or neighborhoods or boroughs in other locations. Defaults to: `null`.
  - languageCode (String.t): Language code of the address. Should be in BCP 47 format. Defaults to: `null`.
  - latLng (LatLng): The latitude and longitude of the location, in degrees. Defaults to: `null`.
  - locality (String.t): Generally refers to the city/town portion of an address. Defaults to: `null`.
  - postalCode (String.t): Values are frequently alphanumeric. Defaults to: `null`.
  - regionCode (String.t): CLDR (Common Locale Data Repository) region code . Defaults to: `null`.
  - sortingCode (String.t): Use of this code is very country-specific, but will refer to a secondary classification code for sorting mail. Defaults to: `null`.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :address => any(),
          :addressLine => list(any()),
          :administrativeArea => any(),
          :dependentLocality => any(),
          :languageCode => any(),
          :latLng => GoogleApi.Partners.V2.Model.LatLng.t(),
          :locality => any(),
          :postalCode => any(),
          :regionCode => any(),
          :sortingCode => any()
        }

  field(:address)
  field(:addressLine, type: :list)
  field(:administrativeArea)
  field(:dependentLocality)
  field(:languageCode)
  field(:latLng, as: GoogleApi.Partners.V2.Model.LatLng)
  field(:locality)
  field(:postalCode)
  field(:regionCode)
  field(:sortingCode)
end

defimpl Poison.Decoder, for: GoogleApi.Partners.V2.Model.Location do
  def decode(value, options) do
    GoogleApi.Partners.V2.Model.Location.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Partners.V2.Model.Location do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
